import http from "./http";
export function login(options) {
    return http.post('/user/login',options)
}

export function toLeave() {
    return http.get('/user/signout')
}

// 获取部门接口
export function getList() {
    return http.get('/department/list')
}
// 新增部门
export function addList(options) {
    return http.post('/department/add',options)
}
// 删除部门
export function delateList(id) {
    return http.get('/department/delete', {
        params: {
            departmentId:id
        }
    })
}
// 获取对应部门的详细信息
export function getListInfo(id) {
    return http.get('/department/info',{
        params: {
            departmentId:id
        }
    })
}
// 更新部门信息
export function updataList(options) {
    return http.post('/department/update',options)
}






// 获取员工列表
export function getUserList(options) {
    return http.get('/user/list', {
        params: options
    })
}
// 增加员工
export function addUser(options) {
    return http.post('/user/add',options)
}
// 修改员工信息
export function updataUser(options) {
    return http.post('/user/update',options)
}
// 获取员工详细信息
export function getUserInfo(id) {
    return http.get('/user/info',{
        params: {
            userId: id
        }
    })
}
// 删除员工
export function deleteUser(id) {
    return http.get('/user/delete', {
        params: {
            userId: id
        }
    })
}





// 获取职务列表
export function getJoblist() {
    return http.get('/job/list')
}
// 增加职务
export function addJobList(options) {
    return http.post('/job/add', options)
}
// 删除职务
export function deleteJob(id) {
    return http.get('/job/delete', {
        params: {
            jobId: id
        }
    })
}
// 更改职务
export  function updataJob(options) {
    return http.post('/job/update',options)
}
// 获取对应部门详细信息
export  function getJobListinfo (id) {
    return http.get('/job/info',{
        params: {
            jobId: id
        }
    })
}





// 获取用户列表
export function getCustomList(options) {
    options = Object.assign({
        lx: 'all',
        limit: 10,
        page: 1,
        type: '',
        search: ''
    },options)
    return http.get('/customer/list', {
        params: options
    })
}
// 新增用户
export function addCustom(options) {
    return http.post('/customer/add',options)
}
// 获取用户详细信息
export function getCustomInfo(id) {
    return http.get('/customer/info',{
        params: {
            customerId: id
        }
    })
}
// 修改用户信息
export function updataCustom(options) {
    return http.post('/customer/update',options)
}
// 删除用户
export function deleteCustom(id) {
    return http.get('/customer/delete', {
        params: {
            customerId: id
        }
    })
}




// 请求互访信息
export function visitList(id) {
    return http.get('/visit/list', {
        params: {
            customerId: id
        }
    })
}
// 添加回访信息
export function addvisit(options) {
    return http.post('/visit/add', options)
}
// 删除回访信息
export function deleteVisit(id) {
    return http.get('/visit/delete', {
        params: {
            visitId: id
        }
    })
}
// 修改回访信息
export function updataVisit(options) {
    return http.post('/visit/update',options)
}
// 获取回访详细信息
export function getVisitInfo(id) {
    return http.get('/visit/info', {
        params: {
            visitId: id
        }
    })
}
